<!--更新矿工信息-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>修改矿工信息</title>
    <link rel="stylesheet" href="../lib/layui-v2.6.3/css/layui.css">
</head>
<body>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
    <legend>修改矿工信息</legend>
</fieldset>
<!--面板-->
<div class="layui-card">
    <div class="layui-card-header"></div>
    <div class="layui-card-body">
        <!--表单-->
        <form class="layui-form"> <!-- 提示：如果你不想用form，你可以换成div等任何一个普通元素 -->
            <div class="layui-form-item">
                <label class="layui-form-label">工号</label>
                <div class="layui-input-block">
                    <input type="text" name="id" placeholder="必填" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">姓名</label>
                <div class="layui-input-block">
                    <input type="text" name="name" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">性别</label>
                <div class="layui-input-block">
                    <select name="sex">
                        <option value=""></option>
                        <option value="男">男</option>
                        <option value="女">女</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">电话</label>
                <div class="layui-input-block">
                    <input type="text" name="phone" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">家庭住址</label>
                <div class="layui-input-block">
                    <input type="text" name="address" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">身份证号</label>
                <div class="layui-input-block">
                    <input type="text" name="IDNumber" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">职位</label>
                <div class="layui-input-block">
                    <select name="position">
                        <option value=""></option>
                        <option value="采矿工">采矿工</option>
                        <option value="掘进工">掘进工</option>
                        <option value="电工">电工</option>
                        <option value="瓦斯检察员">瓦斯检察员</option>
                        <option value="测风工">测风工</option>
                        <option value="防尘工">防尘工</option>
                        <option value="通风工">通风工</option>
                        <option value="放炮员">放炮员</option>
                        <option value="安全员">安全员</option>
                        <option value="推车工">推车工</option>
                        <option value="其他">其他</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">工作内容</label>
                <div class="layui-input-block">
                    <input type="text" name="job" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否在职</label>
                <div class="layui-input-block">
                    <select name="status">
                        <option value=""></option>
                        <option value="在职">是</option>
                        <option value="离职">否</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">提交</button>
                    <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>

<script src="../lib/jquery-3.4.1/jquery-3.4.1.min.js"></script>
<script src="../lib/layui-v2.6.3/layui.js"></script>
<script src="//lib.baomitu.com/layer/3.5.1/layer.js"></script>

<script>
    //Demo
    layui.use('form', function() {
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function (data) {
            $.ajax({
                url: "/miner/update",
                type: "POST",
                data: data.field,
                dataType: "JSON",
                success: function (result) {
                    layer.msg(result);
                }
            })
            layer.msg('更新成功',{
                time:1000,
                icon:1,
            });
            return false;
        });
    })
</script>
</body>
</html>